package org.yuankan.yuankanmanagerserver.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.data.annotation.Reference;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Component
@RefreshScope
@RequestMapping("/test")
public class TestController {

//    @Value("${env}")
//    public String env;

    @Value("${name}")
    private String name;

    @Value("${age}")
    private int age;

    @Value("${env}")
    private String env;

    @Value("${param.text}")
    private String paramText;

    @Value("${param.name}")
    private String paramName;
    @RequestMapping("/get")
    public String test(){
         String env="poooo";
        System.out.println("配置文件获取："+paramName);
        return paramName;
    }

    @GetMapping("/page")
    public String loginPage() {
        return "<html>" +
                "<head><title>Login Page</title></head>" +
                "<body>" +
                "<h1>Login Page</h1>" +
                "<a href=\"/login/wechat\">Login with WeChat</a><br>" +
                "<a href=\"/login/alipay\">Login with Alipay</a>" +
                "</body>" +
                "</html>";
    }
}



